﻿<!DOCTYPE html>

<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <title>俄罗斯方块</title>
    <script src="./scripts/tetris.js"></script>
    <style type="text/css">
        #gb {
            height: 1920px;
            width: 1080px;
            background-color: bisque;
        }
    </style>
    <script type="text/javascript">
        var game;
        var canvas;
        function onClick() {
            if (game) {
                game.rotateBlock();
            }
        }
        document.onreadystatechange = function (e) {
            if (document.readyState == 'complete') {
                canvas = document.getElementById("gb");
                canvas.addEventListener("click", onClick);
                game = new Tetris(canvas);
            }
        };


    </script>
</head>
<body>
    <canvas id="gb"></canvas>
</body>
</html>
